<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="http://www.w3.org/1999/xhtml" version="1.0">

  <xsl:template name="formal.object.heading">
    <xsl:param name="object" select="."/>
    <xsl:param name="formal.object.with.label" select="self::figure|self::table|self::example|self::equation"/>
    <xsl:param name="formal.object.with.label.markup" select="self::figure|self::table|self::equation"/>
    
    <!-- divide formal object heading and make it support formal.title.label.properties -->
    <xsl:param name="title">
      <xsl:if test="$formal.object.with.label">
        <!-- have label -->
        <xsl:call-template name="gentext">
          <xsl:with-param name="key" select="local-name()"/>
        </xsl:call-template>
        <xsl:if test="formal.object.autolabel != '0'">
          <!-- test if formal objects must be numbered -->
          <xsl:if test="$formal.object.with.label.markup">
            <!-- have label.markup -->
            <xsl:text disable-output-escaping="yes">&#xa0;</xsl:text>
            <xsl:apply-templates select="$object" mode="label.markup">
              <xsl:with-param name="allow-anchors" select="1"/>
            </xsl:apply-templates>
          </xsl:if>
        </xsl:if>
        <xsl:value-of select="$xref.label-title.separator"/>
      </xsl:if>
      <xsl:apply-templates select="$object" mode="title.markup">
        <xsl:with-param name="allow-anchors" select="1"/>
      </xsl:apply-templates>
    </xsl:param>

    <p class="title">
      <b>
        <xsl:copy-of select="$title"/>
      </b>
    </p>
  </xsl:template>


</xsl:stylesheet>
